﻿<Controls:UIControl x:Class="eStock.Controls.UIComponents"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:CustomControls="clr-namespace:eStock.Controls.CustomControls"
             xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:Controls="clr-namespace:eStock.Controls"
               mc:Ignorable="d" 
             d:DesignHeight="600" d:DesignWidth="800" Background="White">
    <Controls:UIControl.Resources>
        <ResourceDictionary>
        <DataTemplate x:Key="UIComponentLBTemplate">
            <StackPanel Margin="3">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                       
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        <TextBlock FontWeight="Bold" Text="Name:" Foreground="DarkOrange" FontSize="15" Grid.Row="0" Grid.Column="0" Margin="5,0,10,0"/>
                        <TextBlock Text="{Binding Title, Mode=OneWay}" FontWeight="Bold" FontSize="15" Grid.Row="0" Grid.Column="1"/>
                        
                            <TextBlock FontWeight="Bold" Text="Kategorie:" Foreground ="DarkOrange" Grid.Row="1" Grid.Column="0" Margin="5,0,5,0"/>
                        <StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="1">
                            <TextBlock Text="{Binding Type.Category.Title, Mode=OneWay}"/>
                            <TextBlock FontWeight="Bold" Text=" Typ:" Foreground="DarkOrange" Margin="5,0,5,0"/>
                            <TextBlock Text="{Binding Type.Title, Mode=OneWay}" />
                        </StackPanel>
                    </Grid>
                        
            </StackPanel>
        </DataTemplate>
        </ResourceDictionary>
    </Controls:UIControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition Width="auto"/>
        </Grid.ColumnDefinitions>
        
        <DockPanel Grid.Column="0" Margin="10">
            <CustomControls:UICustomLabel DockPanel.Dock="Top" Header="Suche:  ">
                <CustomControls:UICustomLabel.Child>
                    <TextBox />
                </CustomControls:UICustomLabel.Child>
            </CustomControls:UICustomLabel>
            <ListBox Name="lbComponents" ItemTemplate="{StaticResource UIComponentLBTemplate}" />
        </DockPanel>

        <StackPanel Grid.Column="1">
            <DockPanel LastChildFill="True">
                <Image DockPanel.Dock="Right" Margin="0,10,10,0"  VerticalAlignment="Top"  MaxHeight="140" Height="140" MinWidth="140" MaxWidth="140" Source="..\Images\default.png"/>
                <StackPanel Margin="10" Width="450" DockPanel.Dock="Left">
                    <TextBlock Name="txtTitle" FontWeight="Bold" FontSize="17" Margin="0,0,0,5"/>
                    <TextBox Name="txtDescription" Margin="0,0,0,5" IsReadOnly="true" TextWrapping="Wrap" AcceptsReturn="True" Height="75" VerticalScrollBarVisibility="Auto" />
               
                    <DockPanel LastChildFill="True" Margin="0,5,0,0">
                        <Button Content="Details" Name="btnDetailsCategory" DockPanel.Dock="Right" Margin="5,0,0,0" Width="70" Click="BtnDetailsCategoryClick" />
                        <CustomControls:UILabel x:Name="txtCategory" HeaderWidth="80" Header="Kategorie: " ReadOnly="true"/>
                    </DockPanel>
                </StackPanel>
            </DockPanel>
            <DockPanel LastChildFill="True" Margin="5,5,10,5">
                <Label DockPanel.Dock="Left" Content="Lagerbestand: " />
                <DataGrid Name="dgStock" Height="150" BorderBrush="#FFBBBBBB" >
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{x:Null}" ClipboardContentBinding="{x:Null}" Header="Lager"/>
                        <DataGridTextColumn Binding="{x:Null}" ClipboardContentBinding="{x:Null}" Header="Preis"/>
                    </DataGrid.Columns>
                </DataGrid>

            </DockPanel>
        </StackPanel>
        <xctk:ChildWindow Name="cldCategory" Visibility="Hidden"  Grid.Column="1"  Caption="Kategorie" Height="350" IsModal="True" Width="470" Top="150">
            <DockPanel LastChildFill="True">
                <StackPanel Margin="10" DockPanel.Dock="Right" Width="240">
                    <CustomControls:UILabel x:Name="cldCatTxtTitle" HeaderWidth="77" Header="Titel: " ReadOnly="true"/>
                    <CustomControls:UICustomLabel HeaderWidth="77" Header="Beschreibung: ">
                        <CustomControls:UICustomLabel.Child>
                            <TextBox Name="cldCatTxtDescription" Margin="0,0,0,5" IsReadOnly="true" TextWrapping="Wrap" AcceptsReturn="True" Height="50" VerticalScrollBarVisibility="Auto" />
                        </CustomControls:UICustomLabel.Child>
                    </CustomControls:UICustomLabel>
                </StackPanel>
                <TreeView Margin="10" Name="tvItems" SelectedItemChanged="TvItemsSelectedItemChanged" />
            </DockPanel>
        </xctk:ChildWindow>

        <xctk:ChildWindow Grid.Column="1" Visibility="Hidden" Name="cldShop" Caption="Geschäft" Height="350" IsModal="True" Width="500" Top="150">
            <DockPanel LastChildFill="True">
                <StackPanel Margin="10" DockPanel.Dock="Right" Width="180">
                    <Image Name="cldShopImage" />
                </StackPanel>
                <StackPanel Margin="10,10,0,10">
                    <CustomControls:UILabel x:Name="cldShopTxtName" HeaderWidth="77" Header="Name: " ReadOnly="true"/>
                    <CustomControls:UILabel x:Name="cldShopTxtStreet" HeaderWidth="77" Header="Adresse: " ReadOnly="true"/>
                    <DockPanel LastChildFill="true">
                        <CustomControls:UILabel x:Name="cldShopTxtPLZLoc" HeaderWidth="77" Header="" ReadOnly="true"/>
                    </DockPanel>
                    <CustomControls:UILabel x:Name="cldShopTxtPohne" HeaderWidth="77" Header="Telefon: " ReadOnly="true"/>
                    <CustomControls:UILabel x:Name="cldShopTxtMail" HeaderWidth="77" Header="eMail: " ReadOnly="true"/>
                    <CustomControls:UILabel x:Name="cldShopTxtWeb" HeaderWidth="77" Header="Web: " ReadOnly="true"/>
                    <CustomControls:UILabel x:Name="cldShopTxtBlz" HeaderWidth="77" Header="BLZ: " ReadOnly="true" Margin="0,10,0,0"/>
                    <CustomControls:UILabel x:Name="cldShopTxtKonto" HeaderWidth="77" Header="Konto: " ReadOnly="true"/>
                    <CustomControls:UICustomLabel HeaderWidth="77" Header="Beschreibung: " Margin="0,10,0,0">
                        <CustomControls:UICustomLabel.Child>
                            <TextBox Name="cldShopTxtDescription" Margin="0,0,0,5" IsReadOnly="true" TextWrapping="Wrap" AcceptsReturn="True" Height="50" VerticalScrollBarVisibility="Auto" />
                        </CustomControls:UICustomLabel.Child>
                    </CustomControls:UICustomLabel>
                </StackPanel>
            </DockPanel>
        </xctk:ChildWindow>
    </Grid>
</Controls:UIControl>

    